/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package weapons;

import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import javax.swing.ImageIcon;

/**
 *
 * @author RoKe
 */
public class BurningArrow extends Weapon {

    private boolean visible;
    private Image image;
    private int width, height;
    private final int damage = 50;
    private final int move_speed = 2;

    public BurningArrow(int x, int y, int direction) {
        super(x, y, direction);
        ImageIcon ii =
                new ImageIcon(this.getClass().getResource("arrow.png"));
        image = ii.getImage();
        visible = true;
        width = image.getWidth(null);
        height = image.getHeight(null);
    }

    @Override
    public void draw(Graphics2D g2d) {
        g2d.drawImage(image, x, y, null);
    }

    @Override
    public void move() {
        if (direction == 0) {
            x += move_speed;
        } else {
            x -= move_speed;
        }
        if (x > 480 || x < 0) {
            visible = false;
        }
    }

    @Override
    public Image getImage() {
        return image;
    }

    @Override
    public int getDamage() {
        return damage;
    }

    @Override
    public Rectangle getBounds() {
        return new Rectangle(x, y, width, height);
    }

    @Override
    public boolean isVisible() {
        return visible;
    }
}
